package com.bk.controller;

import com.bk.domain.Comment;
import com.bk.service.CommentService;
import com.bk.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/comment")
public class CommentController {
    @Autowired
    private CommentService commentService;

    @GetMapping("/list/{articleId}")
    public Result getCommentList(@PathVariable Integer articleId){
        return commentService.getCommentList(articleId);
    }

    @PostMapping
    public Result addComment(@RequestBody Comment comment){
        return commentService.addComment(comment);
    }

}
